
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>
<%@ include file="/common/dateUtil.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<script>
$().ready(function() {
		 $("#entityForm").validate(); //初始化验证信息

		 $("#btnRemove").click(function()
		{
			 var entityId = ${entity.entityId};
			 if(entityId > 0)
			{
				$.messager.confirm('确认','你确定要销户吗?',function(r){
					if (r){		
						var actionUrl ="<%=ApplicationPath%>/terminalInfo/delete.action?entityId=" + entityId;
			            //Utility.deleteEntity('delete.action', entityId);
						
						$.getJSON(actionUrl, function(result){
							if (result.success == true) {
						        window.opener.refreshTable();
								$.messager.alert('提示',"销户成功!","info", function()
								{
			                    window.close();
								});
							}
							else 
								$.messager.alert('提示',"无法销户! 错误原因：" + result.message);
						});
					}
	            });
			}else				
			   window.close();

		});

		//ajax填充下拉框数据
		 $("#termType").lookup({category:"TerminalType", selectedValue:"${entity.termType}"});//终端类型
		 $("#state").lookup({category:"TerminalState", selectedValue:"${entity.state}"}); //终端状态
		 Utility.initDatepicker();//初始化日期选择框
		 var mesasge = "${message}";
			if(mesasge.length > 0)
			{
				//保存成功后，刷新主窗口数据
				 window.opener.parent.refreshDataWindow();
			}
});
</script>
 <BODY>


	<form id="entityForm" name="entityForm" 
			action='<%=ApplicationPath%>/terminalInfo/save.action' method="POST">
				<input type="hidden" name="entityId"
					value="${entity.entityId}"/>
  <table width="100%"  class="TableBlock">
  <tr>
						<td colspan="4" style="font-weight: bold; background: #EFEFEF;" height="25">终端信息管理
						<span class="MessageFromServer">${message}</span>
						</td>
					</tr>
			<tr>				
				<td align="right" >唯一终端ID号
					:</td>
				<td align="left"><input type="text" 
					id="termNo" value="${entity.termNo}"
					name="termNo" maxLength="7"
					size="20" class="{required:true,maxlength:7}"  /> <span class="star">*</span>
				</td>
				<td align="right">终端类型
					:</td>
				<td>
				<select name="termType" id="termType" style="width:150px" class="required">  
				</select>
					</td>
			</tr>
			<tr>
			<td align="right">设备当前状态:</td>
				<td align="left"><select name="state" id="state" style="width:150px;" class="required">
</select>
				</td>
				<td align="right">安装时间:</td>
				<td align="left">
							  <input type="text" name="installTime"  class="datepicker" value='<fmt:formatDate pattern="yyyy-MM-dd" value="${entity.installTime}" />'></input>
				</td>
				</tr>
				<!--
				<tr>
				<td align="right">Sim卡流水号:</td>
				<td align="left"><input 	id="seqNo" value="${entity.seqNo}" name="seqNo"
					maxLength="11" size="20" /> 
				</td>
				<td align="right">手机号码:</td>
				<td align="left"><input class="digits" id="simNo"
					value="${entity.simNo}" name="simNo"
					maxLength="11"
					size="20" /> 
				</td>
			</tr>
			-->
			<tr>
				<td align="right">软件版本号:</td>
				<td align="left">
					<input type="text" name="verSoftware" value="${entity.verSoftware}" id="verSoftware"  size="20" >
				</td>
				<td align="right">硬件版本号 :</td>
				<td>
					<input type="text" name="verHardware" value="${entity.verHardware}" id="verHardware"  size="20"  />
				</td>
			</tr>
			
			<tr>				
				<td align="right">出厂号:</td>
				<td><input class="" id="devNo"
					value="${entity.devNo}" name="devNo"
					 size="20" /> 
				</td>
				<td align="right">安装工
					:</td>
				<td><input type="text" name="waitor" size="20" maxlength="10" value="${entity.waitor}" id="waitor"/></td>
			</tr>
			<!--
			<tr>

				<td>安装地址:</td>
				<td align="left" colspan="3"><input type="text" name="installAddress" size="90" maxlength="60" value="${entity.installAddress}" id="installAddress"/>
					
				</td>

			</tr>-->
			
		
			<tr>
				<td align="right">备注:</td>
				<td align="left" colspan="3"><input type="text" name="remark" size="68" maxlength="60" value="${entity.remark}" id="remark"/>
				</td>

			</tr>
		
			<tr>
				<td colspan="4">
					<div align="center">

						<button type="submit" class="button green medium" ><i class="fa fa-check" style="margin-right:3px;"></i> 保存</button>

						<button id="btnRemove" type="submit" class="button red medium" ><i class="fa fa-close" style="margin-right:3px;"></i> 销户</button>

							

					</div></td>
			</tr>
		</table>
 </BODY>
</HTML>
